    //
    //  HomeViewController.m
    //  ZooNgonDoiOS
    //
    //  Created by Trung sound on 6/4/12.
    //  Copyright (c) 2012 Personal. All rights reserved.
    //

#import "HomeViewController.h"
#import "ZooLoginController.h"
#import "DetailViewController.h"
#import "HomeScreen.h"
#import "MainScreen.h"

@implementation HomeViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
            // Custom initialization
        
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
        // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
        // Release any cached data, images, etc that aren't in use.
}

    //- (void)viewDidLoad {  
    //    [super viewDidLoad];
    //    HomeScreen *_homeScreen = [[HomeScreen alloc]initWithFrame:CGRectMake(0, 0, 320, 460)];
    //    _homeScreen.parent = self;
    //    self.view = _homeScreen;
    //}


#pragma mark - View lifecycle


    // Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
        //    HomeScreen *_homeScreen = [[HomeScreen alloc]initWithFrame:CGRectMake(0, 0, 320, 460)];
        //    _homeScreen.parent = self;
        //    self.view = _homeScreen;
    
    MainScreen *_mainScreen = [[MainScreen alloc]initWithFrame:CGRectMake(0, 0, 320, 460)];
    _mainScreen.parent = self;
    self.view = _mainScreen;
    
}

/*
 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
 - (void)viewDidLoad
 {
 [super viewDidLoad];
 }
 */

- (void)viewDidUnload
{
    [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
        // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}



- (void) pushToLoginScreen {
    ZooLoginController *zooLoginController = [[ZooLoginController alloc]initWithNibName:@"ZooLoginController" bundle:nil ];
    
    [self.navigationController pushViewController:zooLoginController animated:YES];
        //    [self dismissModalViewControllerAnimated:YES];
}

- (void) pushToDetailController:(ZooSpotBean *)pSpot {
    DetailViewController *detailViewController = [[DetailViewController alloc]initWithSpot:pSpot];
    detailViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    detailViewController.spotDetailDelegate = self;
    [self.navigationController pushViewController:detailViewController animated:YES];
    [detailViewController release];
}

- (void) backToHomeView {
    [self dismissModalViewControllerAnimated:YES];
}

@end
